package com.windfone.web.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.windfone.model.Product;
import com.windfone.service.ProductService;

public class MobileCenterAction extends ActionSupport {
	private ProductService productService;
	private int typeId =-1;
	private int status ;
	private List<Product> products;
	public List<Product> getProducts() {
		return products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public void setProductService(ProductService productService) {
		this.productService = productService;
	}

	@Override
	public String execute() throws Exception {
		if ( typeId !=-1){
			products = productService.getAllProductByStatus(typeId,status);
		}
		typeId=-1;
		return SUCCESS;
	}

	public int getTypeId() {
		return typeId;
	}

	public void setTypeId(int typeId) {
		this.typeId = typeId;
	}
	
}
